package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the componenti_pacchetti database table.
 * 
 */
@Embeddable
public class ComponentiPacchettiPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="id_pacchetto")
	private int idPacchetto;

	@Column(name="id_elemento")
	private int idElemento;

	public ComponentiPacchettiPK() {
	}
	
	
	
	public ComponentiPacchettiPK(int idPacchetto, int idElemento) {
		super();
		this.idPacchetto = idPacchetto;
		this.idElemento = idElemento;
	}



	public int getIdPacchetto() {
		return this.idPacchetto;
	}
	public void setIdPacchetto(int idPacchetto) {
		this.idPacchetto = idPacchetto;
	}
	public int getIdElemento() {
		return this.idElemento;
	}
	public void setIdElemento(int idElemento) {
		this.idElemento = idElemento;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ComponentiPacchettiPK)) {
			return false;
		}
		ComponentiPacchettiPK castOther = (ComponentiPacchettiPK)other;
		return 
			(this.idPacchetto == castOther.idPacchetto)
			&& (this.idElemento == castOther.idElemento);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idPacchetto;
		hash = hash * prime + this.idElemento;
		
		return hash;
	}
}